<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<link rel="stylesheet" type="text/css" href="/bigjo/css/jquery.jqplot.css" />
<script type="text/javascript" src="/bigjo/js/jquery.js"></script>
<script type="text/javascript" src="/bigjo/js/jquery.jqplot.js"></script>
<script type="text/javascript" src="/bigjo/js/jqplot.pieRenderer.js"></script>
<script type="text/javascript" src="/bigjo/js/jqplot.donutRenderer.js"></script>
<title>Insert title here</title>
</head>
	<script type="text/javascript">
		$(document).ready(function(){
			var g_genre;
			var mogl_count;
			var data = new Array();
			var test;
			for(var i = 0 ; i < 10;i++){
				g_genre = $("#fabruary"+i).attr("g_genre");
				mogl_count = $("#fabruary"+i).attr("mogl_count");
				if(g_genre == "" && mogl_count == ""){
					if(g_genre == null && mogl_count == null){
						break;
					}
				}else{/* 
					alert("장르 : "+g_genre);
					alert("카운터 : "+mogl_count); */
					data[i]= [g_genre , Number(mogl_count)];
				}
			}
			
			plot1 = jQuery.jqplot ('chart1', [data],
				{ 
				grid: {
		            drawBorder: false, 
		            drawGridlines: false,
		            background: '#ffffff',
		            shadow:false
		        },
		        axesDefaults: {
		             
		        },
		        seriesDefaults:{
		            renderer:$.jqplot.PieRenderer,
		            rendererOptions: {
		                showDataLabels: true
		            }
		        },
		        legend: {
		            show: true,
		            rendererOptions: {
		                numberRows: 1
		            },
		            location: 's'
		        }
		     });
		});
	</script>

<body>
	<div id="chart1"></div>
	<%int i = 0 ; %>
	<c:forEach var="fabruary" items="${februarychart}">
		<input type="hidden" id="fabruary<%=i++%>"
			g_genre="${fabruary.genrebean.g_genre}"
			mogl_count="${fabruary.monthglbean.mogl_count}" >
	</c:forEach>
</body>
</html>
